import axios from "axios";
const url = "http://121.41.11.36:3000/yidianling";
const http = {
  get(aurl, obj) {
    return new Promise((resolve) => {
      axios
        .get(url + aurl, { params: obj })
        .then(function (response) {
          resolve(response);
        })
        .catch(function (error) {
          console.log(error);
        });
    });
  },
  post(aurl, obj) {
    return new Promise((resolve) => {
      axios
        .post(url + aurl, obj)
        .then(function (response) {
          resolve(response);
        })
        .catch(function (error) {
          console.log(error);
        });
    });
  },
};

export default http;
